package com.time.company.components.dialog;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.widget.TextView;

import com.time.company.R;


/**
 * Created by Bing on 2017/5/16.
 * E-mail is tx16bing@163.com
 */

public class LoadingDialog extends Dialog {

    private String mTip;

    public LoadingDialog(@NonNull Context context) {
        super(context, R.style.Wait_Dialog);
    }

    public LoadingDialog(@NonNull Context context, String tip) {
        super(context, R.style.Wait_Dialog);
        this.mTip = tip;
    }

    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_loading);
        findViewById(R.id.ll_dialog_parent).getBackground().setAlpha(210);
        TextView tvTip = findViewById(R.id.tv_dialog_tip);
        if (TextUtils.isEmpty(mTip)){
            tvTip.setText(mTip);
        }
    }
}
